package com.monkeys.mapper;

import com.monkeys.pojo.Poi;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author KuangTeam
 */
@Mapper
public interface PoiMapper {
    @Select("select id, name, type, address, lng, lat, province, city, district from pois where id = #{senderId}")
    Poi selectById(Integer senderId);

    @Select("select material from pois where id = #{id}")
    String getTypeById(Integer id);

    @Select("SELECT id FROM pois WHERE material = #{material} ORDER BY RAND() LIMIT 1;")
    Integer getIdByMaterial(String material);
}
